﻿Login = Class.create();

Login.prototype = Object.extend(new Common(), {
    initialize: function () {
        this.initCommonProperty();
    },

    init: function () {
        //绑定登录按钮时间
        Event.observe($("login"), 'click', this.onClick_Login.bind(this));
    },
    //登录点击触发事件
    onClick_Login: function () {
        //获取页面中值
        this.inputModel = this.getInputModel();

        //发送Ajax
        this.sendAjaxByModel("/Admin/LoginClick", this.inputModel, this.getLoginCallback.bind(this));
    },
    //回调处理
    getLoginCallback: function (response) {
        //转换成json
        var json = this.jsonParse(response);
        if (json.result > 0) {
            window.location = "/Default/Index";
        }
        else {
            CmnMessage.showMessage("帐号或密码出错！", MSG_TYPE_INFO);

        }
    }
});